import axios from "../../utils/request"

export const addAddress = (data: {  userId:Number; address: string; addressType: Number }) => {
  return axios({
    url:"http://localhost:8080/mypage/address",
    method:"post",
    data
  })
};

export const updateAddress = ( data: {addId:Number;userId:Number; address: string; addressType: Number }) => {
  return axios({
    url:"http://localhost:8080/mypage/address",
    method:"put",
    data
  })
};

export const deleteAddress = (userId: number) => {
  return axios({
    url: `http://localhost:8080/mypage/address/${userId}`,
    method: "delete"
  });
};

export const getAddresses = (userId: number) => {
  return axios({
    url: `http://localhost:8080/mypage/addresses?userId=${userId}`,
    method: "get",
  
  });
};